import request from '@/utils/request'

// 获取评论或者评论回复
export const getCommentAjax = (params) => {
  return request({
    url: '/app/v1_0/comments',
    method: 'GET',
    params
  })
}

// 对评论或者评论的回复点赞
export const addCommentLikingAjax = (target) => {
  return request({
    url: '/app/v1_0/comment/likings',
    method: 'POST',
    data: {
      target // 点赞的评论id
    }
  })
}

// 取消对评论或者评论的回复点赞
export const deleteCommentLikingAjax = (target) => {
  return request({
    url: '/app/v1_0/comment/likings/' + target,
    method: 'DELETE'
  })
}

// 添加评论 或者 评论回复
export const addCommentAjax = (data) => {
  return request({
    url: '/app/v1_0/comments',
    method: 'POST',
    data
  })
}